<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->id();
            $table->integer('video_id')->comment('视频ID');
            $table->string('avatar')->nullable()->comment('头像');
            $table->string('nickname')->comment('昵称');
            $table->tinyInteger('sex')->comment('男性/女性 1:男   2：女');
            $table->text('content')->comment('内容');
            $table->integer('reply_count')->comment('回复人数');
            $table->string('district')->comment('评论位置');
            $table->integer('zan_count')->default(0)->comment('点赞人数');
            $table->decimal('score', $precision = 10, $scale = 8)->comment('评论分数');
            $table->date('comment_at')->comment('评论时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('comments');
    }
}
